home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / LaZaRuS XXV.txt < prev    next >
Encoding:
Text File  |  1999-07-24  |  4.9 KB  |  91 lines

  1.  
  2.  
  3.                      L                ZZZZZZ         RRRRR           SSSSS
  4.                      L                    Z          R    R         S
  5.                      L          aaa      Z      aaa  R    R  u   u  S
  6.                      L            a     Z         a  RRRRR   u   u  SSSSS
  7.                XX    L         aaaa    Z       aaaa  R    R  u   u       S
  8.               XXXX   L        a   a   Z       a   a  R    R  u   u       S
  9.              XXXXXX  LLLLLLL  aaaaa  ZZZZZZZ  aaaaa  R    R  uuuuu  SSSSSS
  10.              XXXXXX       
  11.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  12.        XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  13.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  14.              XXXXXX
  15.              XXXXXX
  16.               XXXX        proudly presents his 25.Cracking Tutorial (24.07.1999)
  17.                XX                    Solution to AfKayAs CrackMe #1
  18.  
  19. I.    Introduction
  20. II.   The essay
  21. III.  BTW
  22.  
  23. I.   Currently I am bored, my phone bill doesn't allow joining #cracking4newbies and looking TV
  24.      would bore me even more, so I decided to make something useful. Went to Eternal Bliss'
  25.      site (crackmes.cjb.net) and d/l some tutorials and CrackMes. Even more useful than just
  26.      cracking this little baby, is writing a tut for EB. So, let's start:
  27.  
  28. II.  The essay
  29.      I hope you read my "VB5 in W32Dasm" essay, because this one is VB and I am a 
  30.      W32Dasm-o-holic (I hope you know what that means :P). Yes, this time we will deal with
  31.      my preferred disassembler again :)
  32.      So load CrackMe1.exe in W32Dasm and search for "strc" (I always start like this; "strc" is
  33.      a part of the function name __vbaStrCmp). You will find it three times, twice in the 
  34.      definition and list of all functions at the beginning of the file and one at the end of 
  35.      the file (where it is used). At the end you will see this:
  36.  
  37.      :00402525 8B1D70414000            mov ebx, dword ptr [00404170]
  38.      :0040252B 8BD0                    mov edx, eax
  39.      :0040252D 8D4DE0                  lea ecx, dword ptr [ebp-20]
  40.      :00402530 FFD3                    call ebx
  41.      :00402532 50                      push eax
  42.  
  43.      * Reference To: MSVBVM50.__vbaStrCmp, Ord:0000h
  44.                                        |
  45.      :00402533 FF1528414000            Call dword ptr [00404128]
  46.  
  47.      Strange: Only one PUSH in front of the call to __vbaStrComp? No, the other one (push eax)
  48.      is located few lines above (:0040251C). This "push eax" contains the serial you entered
  49.      and the "push eax" you can see in the code snippet contains the correct serial. So just
  50.      read it out and you have cracked this babe :)
  51.  
  52.      For my name (LaZaRuS) it was: AKA-682793 - If you enter it a messagebox appears telling
  53.      you that you found the correct serial, but you should keygen it, too. So I traced up
  54.      seeing many function names I never heard of and then finally saw the light: __vbaLenBstr
  55.      I thought that this one is a good starting position for a serial calculation. Why? I
  56.      mostly start with getting the length of the name, too :) And - as you will see - I was
  57.      right. So I set a breakpoint in front of the call (:00402412) and started debugging.
  58.  
  59.      * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  60.      |:004023F5(C)
  61.      |
  62.      :00402409 8B9550FFFFFF            mov edx, dword ptr [ebp+FFFFFF50]
  63.      :0040240F 8B45E4                  mov eax, dword ptr [ebp-1C] ;; EAX = NAME
  64.      :00402412 50                      push eax ;; SAVE EAX TO STACK
  65.      :00402413 8B1A                    mov ebx, dword ptr [edx]
  66.  
  67.      * Reference To: MSVBVM50.__vbaLenBstr, Ord:0000h
  68.                                        |
  69.      :00402415 FF15E4404000            Call dword ptr [004040E4] ;; RETURN LENGTH OF NAME IN EAX
  70.      :0040241B 8BF8                    mov edi, eax ;; EDI = LENGTH OF NAME
  71.      :0040241D 8B4DE8                  mov ecx, dword ptr [ebp-18] ;; ECX = NAME
  72.      :00402420 69FFFB7C0100            imul edi, 00017CFB ;; MULTIPLY LENGTH WITH 17CFBh
  73.      :00402426 51                      push ecx
  74.      :00402427 0F8091020000            jo 004026BE
  75.  
  76.      * Reference To: MSVBVM50.rtcAnsiValueBstr, Ord:0204h
  77.                                         |
  78.      :0040242D FF15F8404000            Call dword ptr [004040F8];;GET FIRST CHAR OF NAME (IN EAX)
  79.      :00402433 0FBFD0                  movsx edx, ax ;; EDX = FIRST CHAR
  80.      :00402436 03FA                    add edi, edx ;; ADD ASCII(1st CHAR) TO LENGTH*17CFBh
  81.  
  82.      Yes, that's (nearly) all. Somewhere later you will see that the string "AKA-" is added in
  83.      front of every serial.
  84.  
  85.      You will find the code for a keygen (MASM) inside the ZIP file.
  86.  
  87. III. BTW
  88.      
  89.      Greets to: tKC, Ed!son, Moral Insanity and everyone at #cracking4newbies, +Sandman's forum
  90.      and Fravia+'s forum.
  91.